<?php

namespace app\index\controller;

use app\admin\model\Application;
use app\admin\model\Category;
use app\admin\model\Page;
use app\admin\model\Product;
use app\common\model\Config;

class Base
{
   public $config;
   public $page;
   public $product;
   public $category;
   public $ling;

   public function __construct()
   {
      $config  = Config::order('weigh desc')->select();
      foreach ($config as $item) {
         $this->config[$item->name] = $item->value;
      }
      $this->page = Page::order('id,weigh desc')->select();
      $this->category = Category::order('id,weigh desc')->select();
      $this->product = Product::order('id,weigh desc')->select();
      $this->ling = Application::order('id,weigh desc')->select();
   }


}
